package coms.delegates;

import EJB.EJBLocator;
import coms.dto.Keyword;
import coms.dto.PresentationType;
import coms.ejb.PresentationTypeBeanRemote;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

public class PresentationTypeDelegate implements IDelegate<PresentationType> {

    private PresentationTypeBeanRemote presentationTypeBean;
    
    public PresentationTypeDelegate() {
        try {
            this.presentationTypeBean = EJBLocator.lookupPresentationTypeBean();
        } catch (Exception ex) {
            Logger.getLogger(PresentationTypeDelegate.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public boolean create(PresentationType presentationType) {
        presentationTypeBean.create(presentationType);
        return true;
    }

     @Override
    public boolean delete(PresentationType presentationType) {
        boolean deleted = presentationTypeBean.delete(presentationType);
        return deleted;
    }

     @Override
    public boolean update(PresentationType presentationType) {
        presentationTypeBean.update(presentationType);
        return true;
    }

    @Override
    public List<PresentationType> search(PresentationType t) throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public List<PresentationType> findAll() throws Exception {
        return presentationTypeBean.findAll();
    }
    
    @Override
    public PresentationType getById(int id) throws Exception {
       return presentationTypeBean.getById(id);
    }
}
